#!/usr/bin/env node
const cp = require('child_process');

console.log('I am father process. PID:', process.pid);


process.on('message', (msg) => {
    console.log(`'child',${msg}`);

});
let son= cp.fork('./11-ipc-child.js'),
    dau=cp.fork('./11-ipc-child.js');

setTimeout(() => {
    son.send('son ' );

}, 2000);

setTimeout(() => {
    dau.send('dau');

}, 4000);

setTimeout(() => {
    son.kill('SIGINT');
     dau.kill('SIGINT');
      process.exit();

}, 5000);


